<%@ page import="com.mars.po.User" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: mars
  Date: 2019-06-17
  Time: 22:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Index</title>
</head>
<body>
<div>
    <span>用户id：${sessionScope.user.id}</span><br>
    <span>用户名：${sessionScope.user.username}</span>
</div>
<div>
    <h3>我的商品</h3>
    <table border="1">
        <tr>
            <th>商品id</th>
            <th>商品名</th>
            <th>价格</th>
            <th>库存</th>
        </tr>
        <c:forEach items="${sessionScope.user.products}" var="product">
            <tr>
                <td>${product.id}</td>
                <td>${product.name}</td>
                <td>${product.price}</td>
                <td>${product.storage}</td>
            </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>
